﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    >

    <Style x:Key="Border.Rounded.Floating" TargetType="Border">
        <Setter Property="Background" Value="#EEFFFFFF" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="CornerRadius" Value="5" />
        <Setter Property="Padding" Value="10" />
        <Setter Property="Margin" Value="10" />
        <Setter Property="Effect">
            <Setter.Value>
                <DropShadowEffect
                    Color="Black"
                    Opacity="1"
                    />
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style x:Key="TextBox.Rounded" TargetType="TextBox">
        <Setter Property="FontFamily" Value="Arial" />
        <Setter Property="FontSize" Value="24" />
        <Setter Property="MinHeight" Value="34" />
        <Setter Property="MaxHeight" Value="44" />
        <Setter Property="MinWidth" Value="160" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate
                    TargetType="{x:Type TextBox}"
                    x:Name="MainControlTemplate"
                    >
                    <Border
                        x:Name="Border"
                        Margin="5"
                        Padding="2"
                        CornerRadius="2"
                        BorderThickness="0"
                        BorderBrush="#FFCCCCCC"
                        Background="#FFDCDCDC"
                        SnapsToDevicePixels="True"
                        >
                        <Grid>
                            <ScrollViewer 
                                x:Name="PART_ContentHost" 
                                VerticalAlignment="Center"
                                HorizontalAlignment="Left"
                                Margin="0"
                                />
                        </Grid>
                        <Border.Effect>
                            <DropShadowEffect
                                x:Name="BorderShadow"
                                RenderingBias="Performance"
                                ShadowDepth="0"
                                BlurRadius="10"
                                Color="#FFCCCCCC"
                                />
                        </Border.Effect>
                    </Border>
                    <ControlTemplate.Resources>
                        <SolidColorBrush x:Key="DisabledBackgroundBrush" Color="#FF999999" />
                        <SolidColorBrush x:Key="DisabledForegroundBrush" Color="#FFCCCCCC" />
                    </ControlTemplate.Resources>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="Border" Property="Background" Value="{DynamicResource DisabledBackgroundBrush}" />
                            <Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}" />
                        </Trigger>
                        <EventTrigger RoutedEvent="TextBox.GotFocus">
                            <EventTrigger.Actions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <ColorAnimation
                                            Storyboard.TargetName="BorderShadow"
                                            Storyboard.TargetProperty="Color"
                                            To="Red"
                                            Duration="0:0:0.2"
                                            />
                                    </Storyboard>
                                </BeginStoryboard>
                            </EventTrigger.Actions>
                        </EventTrigger>
                        <EventTrigger RoutedEvent="TextBox.LostFocus">
                            <EventTrigger.Actions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <ColorAnimation
                                            Storyboard.TargetName="BorderShadow"
                                            Storyboard.TargetProperty="Color"
                                            To="#FFCCCCCC"
                                            Duration="0:0:0.2"
                                            />
                                    </Storyboard>
                                </BeginStoryboard>
                            </EventTrigger.Actions>
                        </EventTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>